import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/pages/Login'
import Main from '@/pages/Main'
import Personal from '@/pages/Personal'
import RoleManage from '@/pages/RoleManage'
import AccessManage from '@/pages/AccessManage'

Vue.use(Router)

const PersonalRouter = [{
    path: 'personal',
    name: 'personal',
    component: Personal
}]
const RoleManageRouter = [{
    path: 'roleManage',
    name: 'roleManage',
    component: RoleManage
}]
const AccessManageRouter = [{
    path: 'accessManage',
    name: 'accessManage',
    component: AccessManage
}]

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      children: [...PersonalRouter,...RoleManageRouter,...AccessManageRouter]
    }
  ]
})
